﻿Imports FluentNHibernate.Mapping
Public Class ArticleMap
    Inherits ClassMap(Of nHibernate.Models.ArticleModel)

    Public Sub New()
        '### Table ###'
        LazyLoad()
        '### Basic Properties ###'
        Id(Function(x) x.ArticleID)
        Map(Function(x) x.ArticleDescription)
        Map(Function(x) x.ArticleWeight)
        Map(Function(x) x.ArticleCategory)
        Map(Function(x) x.ArticlePrice1Amount, "price1amount").Not.Nullable.Default(0)
        Map(Function(x) x.ArticlePrice1IsGross, "price1gross").Not.Nullable.Default(1)
        Map(Function(x) x.ArticlePrice1Currency, "price1currency").Not.Nullable.Default(0)
        Map(Function(x) x.ArticlePrice2Amount, "price2amount").Not.Nullable.Default(0)
        Map(Function(x) x.ArticlePrice2IsGross, "price2gross").Not.Nullable.Default(1)
        Map(Function(x) x.ArticlePrice2Currency, "price2currency").Not.Nullable.Default(0)
        Map(Function(x) x.ArticlePrice3Amount, "price3amount").Not.Nullable.Default(0)
        Map(Function(x) x.ArticlePrice3IsGross, "price3gross").Not.Nullable.Default(1)
        Map(Function(x) x.ArticlePrice3Currency, "price3currency").Not.Nullable.Default(0)
        Map(Function(x) x.ArticleText)

        '### References ###'
        References(Function(x) x.TaxClass).Not.LazyLoad()
        References(Function(x) x.ArticleUnit).Not.LazyLoad()

    End Sub
End Class
